#ifndef CINCHUNK_H_
#define CINCHUNK_H_

#include "cbinarychunk.h"

/**
 * CInChunk - class representing block of binary file and its in operations
 * @author Michal Rost
 * @date 27.10.2007
 */
class CInChunk : public CBinaryChunk {
public:
  CInChunk();
  CInChunk(const CInChunk &chunk);
  CInChunk& operator = (const CInChunk &chunk);
  unsigned int loadFromStream(istream &fh);
  unsigned int getBytesRead();
  CInChunk readChunk();
  CColor readCColor();
  string readString();
  string readPChar();
  bool readBool();
  double readDouble();
  float readFloat();
  short readShort();
  char readChar();
  int readInt();
  unsigned short readUShort();
  unsigned char readUChar();
  unsigned int readUInt();
  void readBuffer(char* buf, unsigned int bufSize);
  static string getClassName() {
    return "CInChunk";
  }
protected:
  unsigned int bytesRead;
  void init();
  CInChunk readChunk(istream &fh, unsigned int &fhBytesRead);
  void copyFrom(const CInChunk &chunk);
};

#endif
